package com.boil.qz.safekavass.web.request.param;

import com.boil.util.Constants;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

/**
 * Created by ChenYong on 2017-07-12.
 * <br>
 * 资源列表的请求参数。
 */
public class ResourceListParam extends Page2Param {
    /**
     * 资源名称
     */
    @Length(min = Constants.VALUE_0, max = Constants.VALUE_50, message = "资源名称的长度在1至50个字之间")
    private String resourceName;
    /**
     * 父资源名称
     */
    @Length(min = Constants.VALUE_0, max = Constants.VALUE_50, message = "父资源名称的长度在1至50个字之间")
    private String parentName;
    /**
     * 资源类型
     */
    @Range(max = Constants.VALUE_999, message = "资源类型不能超过999")
    private Integer resourceType;
    /**
     * 权限代码
     */
    @Length(min = Constants.VALUE_0, max = Constants.VALUE_50, message = "权限代码的长度在0至50个字符之间")
    private String permissionCode;

    /**
     * 默认构造器。
     */
    public ResourceListParam() {
        super();
    }

    public String getResourceName() {
        return resourceName;
    }

    public void setResourceName(String resourceName) {
        this.resourceName = resourceName;
    }

    public String getParentName() {
        return parentName;
    }

    public void setParentName(String parentName) {
        this.parentName = parentName;
    }

    public Integer getResourceType() {
        return resourceType;
    }

    public void setResourceType(Integer resourceType) {
        this.resourceType = resourceType;
    }

    public String getPermissionCode() {
        return permissionCode;
    }

    public void setPermissionCode(String permissionCode) {
        this.permissionCode = permissionCode;
    }

    @Override
    public String toString() {
        final StringBuffer sb = new StringBuffer("ResourceListParam{");
        sb.append("resourceName='").append(resourceName).append('\'');
        sb.append(", parentName='").append(parentName).append('\'');
        sb.append(", resourceType=").append(resourceType);
        sb.append(", permissionCode='").append(permissionCode).append('\'');
        sb.append(", sEcho=").append(sEcho);
        sb.append(", iColumns=").append(iColumns);
        sb.append(", iSortingCols=").append(iSortingCols);
        sb.append(", iDisplayStart=").append(iDisplayStart);
        sb.append(", iDisplayLength=").append(iDisplayLength);
        sb.append(", startDate='").append(startDate).append('\'');
        sb.append(", endDate='").append(endDate).append('\'');
        sb.append('}');
        return sb.toString();
    }
}